package demo1;

/**
 * Created with IntelliJ IDEA.
 * Description：
 * User：user
 * DATE:2021-10-27
 * Time:16:55
 */
class Shape{
    public void draw(){

    }
}

class Cycle extends  Shape{
    @Override
    public void draw() {
        System.out.println("圆形");
    }
}
class Rect extends  Shape{
    @Override
    public void draw() {
        System.out.println("矩形");
    }
}
public class TestExemple {
    public static void drawMap(Shape shape){
        shape.draw();
    }

    public static void main(String[] args) {
        Cycle cycle = new Cycle();
        drawMap(cycle);
        Rect rect = new Rect();
        drawMap(rect);
    }

}
